import { Types, defineComponent, type Component, type IWorld, type Entity, hasComponent } from '$lib/ecs';

const damageTypes: Component[] = [];

export const registerDamageType = (dType: Component) => {
  damageTypes.push(dType);
};

export const enumAllDamageTypes = () => {
  return damageTypes;
};

export const enumDamageTypes = (world: IWorld, e: Entity) => {
  return damageTypes.filter((comp) => hasComponent(world, comp, e));
};

export const Slash = defineComponent('Slash', {
  cut: Types.i32,
  sever: Types.i32,
});

export const Blunt = defineComponent('Blunt', {
});
